<template>
  <div>
    <!-- 面包屑部分 -->
    <el-breadcrumb separator-class="el-icon-arrow-right">
      <el-breadcrumb-item :to="{ path: '/home' }">首页</el-breadcrumb-item>
      <el-breadcrumb-item>二维数据</el-breadcrumb-item>
      <el-breadcrumb-item>数据查询</el-breadcrumb-item>
    </el-breadcrumb>
    <el-card>
      <el-row>
        <el-form :model="ruleForm" :rules="rules" ref="ruleForm" label-position="left" label-width="50px" class="demo-ruleForm">
          <el-col :span="12">
            <el-form-item label="性别: " prop="name">
              <el-select v-model="value" placeholder="请选择"></el-select>
              <span class="zhi"> 至 </span>
              <el-select v-model="value" placeholder="请选择"></el-select><el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option></el-form-item>
          </el-col>
          <el-col :span="12">
           <el-form-item label="年龄: " prop="name">
             <el-select v-model="value" placeholder="请选择"></el-select>
             <span class="zhi"> 至 </span>
             <el-select v-model="value" placeholder="请选择"></el-select><el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value"></el-option></el-form-item>
          </el-col>
        </el-form>
      </el-row>
      <el-row class="submit">
        <el-button type="primary">查询</el-button>
      </el-row>
      <el-table :data="tableData" border style="width: 100%">
        <el-table-column prop="id" label="测量编号" width="150px"></el-table-column>
        <el-table-column prop="date" label="上传时间" width="165px"></el-table-column>
        <el-table-column prop="height" label="身高" width="165px"></el-table-column>
        <el-table-column prop="weight" label="前中心长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="前腰节长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="后腰节长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="后背长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="总臂长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="后背长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="后背长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="后背长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="后背长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="后背长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="后背长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="后背长" width="165px"></el-table-column>
        <el-table-column prop="weight" label="后背长" width="165px"></el-table-column>
      </el-table>
      <!-- 分页功能的实现 -->
      <el-pagination
        @size-change="handleSizeChange"
        @current-change="handleCurrentChange"
        :current-page="queryParams.pagenum"
        :page-sizes="[8, 16, 24, 32]"
        :page-size="queryParams.pagesize"
        layout="total, sizes, prev, pager, next, jumper"
        :total="totalPage"
      ></el-pagination>
    </el-card>
  </div>
</template>

<script>
export default {
  data() {
    return {
      ruleForm: {},
      rules: {},
      options: [
        {
          value: '选项1',
          label: '男'
        },
        {
          value: '选项2',
          label: '女'
        }
      ],
      value: '',
      tableData: [{
        id: 156,
        date: '2020-05-02',
        height: 175,
        weight: 70,
        delivery: false
      }, {
        id: 80,
        date: '2018-05-01',
        height: 173,
        weight: 65,
        delivery: false
      }, {
        id: 65,
        date: '2015-04-01',
        height: 185,
        weight: 75,
        delivery: false
      }, {
        id: 45,
        date: '2015-03-02',
        height: 163,
        weight: 55,
        delivery: false
      }, {
        id: 45,
        date: '2015-03-02',
        height: 163,
        weight: 55,
        delivery: false
      }, {
        id: 45,
        date: '2015-03-02',
        height: 163,
        weight: 55,
        delivery: false
      }, {
        id: 45,
        date: '2015-03-02',
        height: 163,
        weight: 55,
        delivery: false
      }],
      // 用户列表请求参数
      queryParams: {
        query: '',
        pagenum: 1,
        pagesize: 8
      },
      // 用户列表的显示总页数
      totalPage: 30
    }
  },
  methods: {
    // 处理pagesize改变事件
    handleSizeChange: function(pageSize) {
      this.queryParams.pagesize = pageSize
      this.getUserList()
    },
    // 处理pagenum改变事件
    handleCurrentChange: function(pageNum) {
      this.queryParams.pagenum = pageNum
      this.getUserList()
    }
  }
}
</script>

<style lang="less" scoped="scoped">
  // .el-col {
  //   padding-left: 80px;
  //   padding-right: 50px;
  // }
  .submit {
    text-align: center;
  }
  .optBtn {
    margin-left: 20px;
    margin-right: 20px;
  }
  .zhi {
    margin: 0 20px;
  }
</style>
